package com.ai.controller.made;

import com.ai.annotation.EnterPathParamLog;
import com.ai.common.CommonResponse;
import com.ai.entity.alarm.RecordAlarmPage;
import com.ai.entity.made.page.CameraPage;
import com.ai.model.dto.RecordInfoDto;
import com.ai.service.made.InformationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 统计信息
 * @Author：xiaosheng
 * @Date：2024-08-13 11:03
 */
@RestController
@RequestMapping("/info")
@Slf4j
public class InformationController {

    @Resource
    InformationService informationService;


    /**
     * 获取今日报警数
     *
     * @return
     */
    @PostMapping("/getTodayRecordNum")
    @EnterPathParamLog
    public CommonResponse getTodayRecordNum(@RequestBody RecordAlarmPage recordAlarmPage ) {
        return informationService.getTodayRecordNum(recordAlarmPage);
    }

    /**
     * 获取今日报警数数量及详细信息----新首页
     * @return
     */
    @PostMapping("/getTodayRecordNumAndDetail")
    @EnterPathParamLog
    public CommonResponse getTodayRecordNumAndDetail(@RequestBody(required = false) RecordInfoDto recordInfoDto) {
        return informationService.getTodayRecordNumAndDetail(recordInfoDto);
    }


    /**
     * 获取本周报警数数量及详细信息----新首页
     * @return
     */
    @PostMapping("/getWeekRecordNumAndDetail")
    @EnterPathParamLog
    public CommonResponse getWeekRecordNumAndDetail(@RequestBody(required = false) RecordInfoDto recordInfoDto ) {
        return informationService.getWeekRecordNumAndDetail(recordInfoDto);
    }

    /**
     * 本月违规告警信息汇总---新首页
     * @return
     */
    @PostMapping("/getMonthRecordNumAndDetail")
    @EnterPathParamLog
    public CommonResponse getMonthRecordNumAndDetail(@RequestBody(required = false) RecordInfoDto recordInfoDto ) {
        return informationService.getMonthRecordNumAndDetail(recordInfoDto);
    }

    /**
     * 统计摄像头状态信息---新首页
     * @return
     */
    @PostMapping("/statisticsOfCameraStatus")
    @EnterPathParamLog
    public CommonResponse statisticsOfCameraStatus(@RequestBody(required = false) RecordInfoDto recordInfoDto ) {
        return informationService.statisticsOfCameraStatus(recordInfoDto);
    }

    /**
     * 统计算法运行状态信息---新首页
     * @return
     */
    @PostMapping("/statisticsAlgorithmStatus")
    @EnterPathParamLog
    public CommonResponse statisticsAlgorithmStatus( ) {
        return informationService.statisticsAlgorithmStatus();
    }

    /**
     * 获取一周报警数
     */
    @PostMapping("/getWeekRecordNum")
    @EnterPathParamLog
    public CommonResponse getWeekRecordNum(@RequestBody RecordAlarmPage recordAlarmPage ) {
        return informationService.getWeekRecordNum(recordAlarmPage);
    }

    /**
     * 获取用户数
     * @return
     */
    @PostMapping("/getUserNum")
    @EnterPathParamLog
    public CommonResponse getUserNum() {
        return informationService.getUserNum();
    }

    /**
     * 获取摄像头数量
     * @return
     */
    @PostMapping("/getCameraNum")
    @EnterPathParamLog
    public CommonResponse getCameraNum() {
        return informationService.getCameraNum();
    }


    /**
     * 获取当前区域所有的摄像头信息
      * @return
     */
    @PostMapping("/getRegionBase")
    @EnterPathParamLog
    public CommonResponse getRegionBase(@RequestBody CameraPage page) {
        return informationService.getRegionBase(page);
    }

    /**
     * 按区域统计报警数
     * @return
     */
    @PostMapping("/getRegionRecord")
    @EnterPathParamLog
    public CommonResponse getRegionRecord() {
        return informationService.getRegionRecord();
    }

    /**
     * 按检测统计报警数
     * @return
     */
    @PostMapping("/getRecordNumByType")
    @EnterPathParamLog
    public CommonResponse getRecordNumByType() {
        return informationService.getRecordNumByType();
    }

}
